package org.eztouch.service;

import org.eztouch.entity.UserEntity;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserService {
	
	@Cacheable(value="default")
	public UserEntity getUser(String id){
		System.out.println("---获取user信息---");
		return getUserFromDB(id);
	}

	private UserEntity getUserFromDB(String id) {
		System.out.println("---getUserFromDB---");
		UserEntity user = new UserEntity();
		user.setId("1");
		user.setName("xiaojl");
		return user;
	}
	
	
}
